package com.puruo.mindhall.bean;


import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * <pre>
 * <b>PageInfo</b>
 * <b>Description: 分页返回对象 </b>
 * <b>@author:wangyong</b>
 * <b>Date:</b> 2021/9/19 17:32
 * <b>Copyright:</b> Copyright 2017-2019 wangyong Technology Co., Ltd. All rights reserved.
 * <b>Changelog:</b>
 *   Ver          Date                    Author                  Detail
 *   ----------------------------------------------------------------------
 *   1.0   2021/9/19 17:32    wangyong     new file.
 * </pre>
 */
public class PageInfo<T> implements Serializable {
    private static final long serialVersionUID = 1L;
    //当前页
    private int page;
    //每页的数量
    private int limit;
    //总记录数
    private long total;
    //结果集
    private List<T> list;
    //动态title
    private Map<String,String> title;

    public PageInfo(Integer getPage, Integer getLimit, Long total, List<T> list) {
        int page = 1;
        int limit = 10;
        if (getPage != null) {
            page = getPage;
        }
        if (getLimit != null) {
            limit = getLimit;
        }
        this.page = page;
        this.limit = limit;
        this.total = total;
        this.list = list;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getLimit() {
        return limit;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public Map<String, String> getTitle() {
        return title;
    }
    public void setTitle(Map<String, String> title) {
        this.title = title;
    }
}